#1
class 学生:
    def __init__(self,学号,姓名,年龄,性别,身高,体重,成绩,家庭地址,电话号码):
        self.学号 = 学号
        self.姓名 = 姓名
        self.年龄 = 年龄
        self.性别 = 性别
        self.身高 = 身高
        self.体重 = 体重
        self.成绩 = 成绩
        self.家庭地址 = 家庭地址
        self.电话号码= 电话号码
    def 学习(self,学习时间,):
        print(self.姓名,"学习了",学习时间)
    def 玩游戏(self,游戏名):
        print(f"{self.姓名}正在玩{游戏名}")
    def 编程(self,写入代码的行数):
        print(f'代码写了{写入代码的行数}行')
    def 数的求和(self,*数字):
        print(f'和为{sum(数字)}')
P1 = 学生(1,'sbs',18,'男',170,170,100,'沈阳','13224193946')
P1.学习(2)
P1.玩游戏("原神空月之歌")
P1.编程(100)
P1.数的求和(10,20,30)
#2
class car:
    def __init__(self,Model,wheels,color,weight,capacity):
        self.Model = Model
        self.wheels = wheels
        self.color = color
        self.weight = weight
        self.capacity = capacity
    def run(self,function):
        print(f"{self.Model}正在{function}")
Ferrari= car('法拉利','4','红色','100kg','10L')
BMW = car('宝马','4','粉色','110kg','20L')
Suzuki = car('铃木','4','银色','120kg','30L')
Wuling =  car('五菱','4','白色','150kg','40L')
Tractor = car('拖拉机','4','灰色','170kg','50L')
Ferrari.run('加油')
BMW.run('洗车')
Suzuki.run('越野')
Wuling.run('塞车')
Tractor.run('待机')
#3
class Notebook:
    def __init__(self,型号,待机时间,颜色,重量,cpu型号,内存大小,硬盘大小):
        self.型号 = 型号
        self.待机时间 = 待机时间
        self.颜色 = 颜色
        self.重量 = 重量
        self.cpu型号 = cpu型号
        self.内存大小 = 内存大小
        self.硬盘大小 = 硬盘大小
    def play(self,game):
        return(f'{self.型号}正在运行{game}')
    def work(self,task):
        return(f'{self.型号}正在{task}')
win10 = Notebook('暗影精灵2','1','黑色','3kg','intel','8G','1TB')
print(win10.play('CSGO'))
print(win10.work('下载'))
#4
# class monkey:
#     def __init__(self,类别,性别,身体颜色,体重):
#         self.类别 = 类别
#         self.性别 = 性别
#         self.身体颜色 = 身体颜色
#         self.体重 = 体重
#     def fire(self,meteria):
#         return(f'{self.类别}正在用{meteria}生火')
#     def learn(self,thing):
#         return(f'{self.类别}正在学习{thing}')
# a1 = monkey('黑猩猩','公','红色','30kg')
# print(a1.fire('木头'))
# print(a1.learn('亲嘴'))
#打电话业务逻辑
class Human:
    def __init__(self,name,sex,money_remaining,mobel,elec,big,time_1,score):
        self.name=name
        self.sex=sex
        self.money_remaining=money_remaining
        self.mobel=mobel
        self.elec=elec
        self.big=big
        self.time=time_1
        self.score=score
    def send(self,info):
        return(f'信息:{info}')
    def call(self,telephone,time):
        if len(telephone) == 0 :
            print('报错')
        elif self.money_remaining < 1:
            print('钱小于1元')
        else:
            print('拨通')
            if time <= 10:
                self.score = 15 * time
                return(time,self.score)

            elif time-10 > 0 and time <= 20:
                self.score = (time-10)*39+150
                return (10 + (time - 10) * 0.8,self.score)
            elif time > 20:
                self.score = (time - 20) * 48 + 540
                return(18+(time-20)*0.65,self.score)
sbs = Human('sbs','男',1,'huawei','5000毫安','11寸','2h',0)
print(sbs.send("我爱玩原神"))
print(sbs.call('1',18))




